package server.business.pojo;

import java.math.BigDecimal;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author FZX
 * @since 2022-08-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
@TableName("blood_price")
@ColumnWidth(20) //列宽
@ContentRowHeight(20)//数据行高
@HeadRowHeight(30)//表头高
@ExcelIgnoreUnannotated   //解决不加ExcelProperty注解的，也会出现在excel中
public class BloodPrice extends Model<BloodPrice> {

    @TableField(exist = false)
    private static final long serialVersionUID=1L;

    @TableId(type = IdType.AUTO)
    private Long id;
    
    @TableField(value = "gmt_create",fill = FieldFill.INSERT)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate;   //创建时间

    @TableField(value = "gmt_modified", fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtModified;    //更新时间

    @TableField(value = "price_execution_number")
    @ExcelProperty(value = "执行文号",index = 3)
    private String priceExecutionNumber;    //血液价格执行文号

    @TableField(value = "price_execution_date")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @ExcelProperty(value = "执行日期",index = 4)
    private Date priceExecutionDate;    //血液价格执行日期

    @TableField(value = "blood_type")
    @ExcelProperty(value = "血液类型",index = 0)
    private String bloodType;   //血液类型

    @TableField(value = "blood_price")
    @ExcelProperty(value = "血液价格(元)",index = 1)
    private BigDecimal bloodPrice;  //血液价格
    
    @TableField(value = "measurement_unit")
    @ExcelProperty(value = "计量单位(毫升)",index = 2)
    private Integer measurementUnit;    //计量单位
    
    @TableField(exist = false)
    private String typeInfo;



    @Override
    public Serializable pkVal() {
          return this.id;
      }


}
